<div class="portlet light bordered">
	<div class="portlet-title">
		<div class="caption font-dark">
			<i class="fa fa-cog font-dark"></i> 
			<span class="caption-subject bold">新增分类</span>
		</div>
	</div>
	<div class="portlet-body form">
		<form role="form" action="/category/add" class="form-horizontal" method="post" enctype="multipart/form-data">
			<div class="modal-body">
				<input type="hidden" name="pid" value="$!category.id">
				<input type="hidden" name="level" value="$!category.level">
				<div class="form-group">
					<label class="control-label col-md-3">*上级类别：</label>
					<div class="col-md-7">
						<label class="control-label">
							#if($category.name)
							<span>$category.name ($category.id)</span>
							#else
							<span>无</span>
							#end
						</label>
					</div>
				</div>
<!-- 				<div class="form-group"> -->
<!-- 					<label class="control-label col-md-3">*类别编码：</label> -->
<!-- 					<div class="col-md-7"> -->
<!-- 						<input type="text" class="form-control" name="id" maxlength="20" required> -->
<!-- 					</div> -->
<!-- 				</div> -->
				<div class="form-group">
					<label class="control-label col-md-3">*类别名称：</label>
					<div class="col-md-7">
						<input type="text" class="form-control" name="name" maxlength="20"  required>
					</div>
				</div>
<!-- 				<div class="form-group"> -->
<!-- 					<label class="control-label col-md-3">排序：</label> -->
<!-- 					<div class="col-md-7"> -->
<!-- 						<input type="text" class="form-control integerNum" name="sort"> -->
<!-- 					</div> -->
<!-- 				</div> -->
				<div class="form-group">
					<label class="control-label col-md-3">*是否启用：</label>
					<div class="col-md-7">
						<select name="display" class="form-control bs-select" data-size="8" required>
							<option value="1" selected>是</option>
							<option value="0">否</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<div class="alert alert-danger">
	                     <strong>注意！</strong> 底层分类需要关联类型和品牌，关联后则不能添加下一级分类
	                </div>
                </div>
				<div class="form-group">
					<label class="control-label col-md-3">关联类型：</label>
					<div class="col-md-7">
	                    <select name="attrGoupId" class="form-control bs-select"  data-size="8" >
	                    	<option value="">请选择</option>
	                    	#foreach($attrGroup in $!attrGroups)
		                    	<option value="$!attrGroup.id" data-name="$!attrGroup.name" >$!attrGroup.name</option>
	                        #end
	                    </select>
					</div>
				</div>
				<div class="form-group">
                     <label class="control-label col-md-3">关联品牌：</label>
                     <div class="col-md-7">
                         <select name="brandIds" class="form-control bs-select" data-size="8" multiple>
                         <option value="">请选择</option>
								#foreach($brand in $!brandList)
									<option value="$!brand.id" data-name="$!brand.name">$!brand.name</option>
								#end
							</select>
                     </div>
                 </div>
<!-- 				<div class="form-group"> -->
<!-- 					<label class="control-label col-md-3">*分类图片：</label> -->
<!-- 					<div class="col-md-7"> -->
<!-- 	                    <div class="mt-element-overlay"> -->
<!-- 							<div class="mt-overlay-1 fileinput fileinput-new" data-provides="fileinput" style="margin-bottom: 0;width: auto;;height: auto;"> -->
<!-- 								<div class="fileinput-new thumbnail" style="width: 100px; height: 100px; margin-bottom: 0"> -->
<!-- 								    <img src="" alt="上传图片">  -->
<!-- 								</div> -->
<!-- 								<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 100px; max-height: 100px;margin-bottom: 0"> </div> -->
<!-- 								<div class="mt-overlay"> -->
<!-- 								    <span class="btn default btn-file" style="padding: 0;"> -->
<!-- 									    <span class="fileinput-new"> 浏览 </span> -->
<!-- 									    <span class="fileinput-exists"> 更改 </span> -->
<!-- 									    <input type="file" id="file" name="file" accept="image/jpg,image/gif,image/bmp,image/jpeg,image/png" >  -->
<!-- 								    </span>` -->
<!-- 								    <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput" style="padding: 0"> 删除 </a> -->
<!-- 								</div> -->
<!--                         	</div> -->
<!-- 						</div> -->
<!-- 					</div> -->
<!-- 				</div> -->
			</div>
			<div class="form-actions right">
                 <a href="javascript:;" thref="/category/list" class="btn green ajax-file add-category"><i class="fa fa-check"></i> 提交</a>
                 <a href="javascript:;" data-dismiss="modal" class="btn btn-outline grey-salsa">返回</a>
            </div>
		</form>
	</div>
</div>
<!-- <script src="/assets/scripts/views-file-add.js" type="text/javascript"></script> -->
<script src="/assets/plugins/bootstrap-select/js/components-bootstrap-select.js" type="text/javascript"></script>
<script type="text/javascript">
	MyTouchSpin.init()
</script>